package com.inheritance.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.inheritance.entity.Notice;
import com.inheritance.mapper.NoticeMapper;
import com.inheritance.service.NoticeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {

    @Resource
    private NoticeMapper noticeMapper;


    @Override
    public int upload(Notice notice) {
        return noticeMapper.insert(notice);
    }

    @Override
    public List<Notice> list() {
        return noticeMapper.selectList(null);
    }

    @Override
    public Boolean delete(String id) {
        int i = noticeMapper.deleteById(id);
        return i > 0;
    }
}
